/** 
 * 投保单详情
 */
var insureorderDetailManaged = function() {
	return {
	    formid:"",
        eledata:[],
		initData : function(orderId) {
            $.ajax({
                type: "POST",
                url:ctx + "/insureOrderApply/getone/"+orderId+"?now=" + new Date().getTime(),
                cache: false,
                contentType: false,
                processData: false,
                success: function(data) {
                    insureorderDetailManaged.showelevatortable(data);
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    debugger;
                },
            });
		},
		initListener : function() {
		},
        showdialog:function(){
            $("#showDetailDlg").modal("show");
        },
        showelevatortable : function(data){
            var formid = insureorderDetailManaged.formid;
		    var order = data.order;
		    var eledata = data.eles;
            insureorderDetailManaged.eledata = eledata;
            $("#"+formid+" #insureCompanyId").val(order.insureCompanyId);
            $("#"+formid+" #insureCompany").val(order.insureCompany);
            $("#"+formid+" #insureLinkman").val(order.insureLinkman);
            $("#"+formid+" #insurePhone").val(order.insurePhone);
            $("#"+formid+" #acceptUnitId").val(order.acceptUnitId);
            $("#"+formid+" #usingArea").val(order.usingArea);
            $("#"+formid+" #usingAddress").val(order.usingAddress);
            $("#"+formid+" #acceptUnit").val(order.acceptUnit);
            $("#"+formid+" #startTime").val(new Date(order.startTime).format('yyyy-MM-dd'));
            $("#"+formid+" #endTime").val(new Date(order.endTime).format('yyyy-MM-dd'));

            InsureOrderApplyManaged.showelevatortable(eledata);
        },
		buildnull:function(value){
        	if(value){
        		return value;
			}else{
        		return "";
			}
		}
	};

}();
$(function(){
    insureorderDetailManaged.formid = 'actDetailForm';
    insureorderDetailManaged.initListener();
});
